---
redirect_from:
  - /recipes
---

# Recipes

These recipes will show you the best practices of using Cube.

### Analytics

- [Calculating daily, weekly, monthly active users](/guides/recipes/analytics/active-users)
- [Implementing event analytics](/guides/recipes/analytics/event-analytics)
- [Implementing funnel analysis](/guides/recipes/analytics/funnels)
- [Implementing retention analysis & cohorts](/guides/recipes/analytics/cohort-retention)

### Authentication & Authorization

- [Authenticate requests to the SQL API with LDAP](/guides/recipes/auth/sql-api-ldap)
- [Authenticate requests to the REST API with Auth0](/guides/recipes/auth/auth0-guide)
- [Authenticate requests to the REST API with AWS Cognito](/guides/recipes/auth/aws-cognito)
- [Authenticate requests to the REST API with Firebase](https://medium.com/@ivo.hohlweck/use-firebase-auth-for-cubejs-a609f213ac67)

### Data sources

- [Using multiple data sources](/guides/recipes/data-sources/multiple-sources-same-schema)
- [Using SSL connections to a data source](/guides/recipes/data-sources/using-ssl-connections-to-data-source)
- [Joining data from multiple data sources](/guides/recipes/query-acceleration/joining-multiple-data-sources)

### Data modeling

- [Calculating average and percentiles](/guides/recipes/data-modeling/percentiles)
- [Calculating nested aggregates](/guides/recipes/data-modeling/nested-aggregates)
- [Calculating period-over-period changes](/guides/recipes/data-modeling/period-over-period)
- [Implementing fiscal year or fiscal quarter dimensions](/guides/recipes/data-modeling/fiscal-year-quarter-dimensions)
- [Implementing Entity-Attribute-Value model](/guides/recipes/data-modeling/entity-attribute-value)
- [Implementing data snapshots](/guides/recipes/data-modeling/snapshots)
- [Using different data models for tenants](/guides/recipes/access-control/using-different-schemas-for-tenants)
- [Using dynamic measures](/guides/recipes/data-modeling/using-dynamic-measures)
- [Using dynamic union tables](/guides/recipes/data-modeling/dynamic-union-tables)
- [Working around string time dimensions](/guides/recipes/data-modeling/string-time-dimensions)

### Code reusability

- [Implementing data model generation](/guides/recipes/code-reusability/schema-generation)
- [Referencing environment variables](/guides/recipes/code-reusability/environment-variables)

### Access control

- [Enforcing role-based access](/guides/recipes/access-control/role-based-access)
- [Enforcing column-based access](/guides/recipes/access-control/column-based-access)
- [Enforcing mandatory filters](/guides/recipes/access-control/enforcing-mandatory-filters)
- [Controlling access to cubes and views](/guides/recipes/access-control/controlling-access-to-cubes-and-views)

### Multitenancy

- [Providing a custom data model for each tenant](/guides/recipes/multitenancy/custom-data-model-per-tenant)

### Queries

- [Getting unique values for a field](/guides/recipes/queries/getting-unique-values-for-a-field)
- [Implementing custom sorting](/guides/recipes/queries/sorting)
- [Implementing pagination](/guides/recipes/queries/pagination)
- [Passing dynamic parameters in a query](/guides/recipes/data-modeling/passing-dynamic-parameters-in-a-query)

### Query acceleration

- [Accelerating non-additive measures](/guides/recipes/query-acceleration/non-additivity)
- [Building pre-aggregations for a date range incrementally](/guides/recipes/query-acceleration/incrementally-building-pre-aggregations-for-a-date-range)
- [Disabling pre-aggregations](/guides/recipes/query-acceleration/disabling-pre-aggregations)
- [Using originalSql and rollup pre-aggregations effectively](/guides/recipes/query-acceleration/using-originalsql-and-rollups-effectively)
- [Refreshing select partitions of a pre-aggregation](/guides/recipes/query-acceleration/refreshing-select-partitions)

### Data exploration

- [Building UI with drilldowns](/guides/recipes/data-exploration/drilldowns)
- [Retrieving numeric values on the front-end](/guides/recipes/data-exploration/cast-numerics)

### Upgrading Cube

- [Migrating from Redis to Cube Store](https://cube.dev/blog/how-you-win-by-using-cube-store-part-1#how-to-migrate-to-cube-store)
- [Migrating from Express to Docker](/guides/recipes/upgrading-cube/migrating-from-express-to-docker)
